package com.xjscrm.console.web.operatePlan;

import com.xjscrm.common.entity.TaskTagAuto;
import com.xjscrm.console.param.operatePlan.*;
import com.xjscrm.console.service.customer.operatePlan.AutoTagPlanService;
import com.xjscrm.console.vo.TaskTagAutoDeviceVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "自动打标签方案管理", tags = "自动打标签方案管理")
@RestController
@RequestMapping(value = "/autoTagPlan")
public class AutoTagPlanController {

@Autowired
private AutoTagPlanService autoTagPlanService;

    @ApiOperation(value = "新增自动打标签方案", notes = "新增自动打标签方案", response = Boolean.class)
    @PostMapping(value = "/addTaskTagAuto")
    public Object addTaskTagAuto(@RequestBody TaskTagAutoDto taskTagAutoDto)throws Exception{
        autoTagPlanService.addTaskTagAuto(taskTagAutoDto);
        return true;
    }


    @ApiOperation(value = "查询自动打标签方案列表", notes = "查询自动打标签方案列表", response = TaskTagAuto.class)
    @PostMapping(value = "/getTaskTagAutoList")
    public  Object getTaskTagAutoList(@RequestBody TaskTagAutoQuery taskTagAutoQuery)throws Exception{
       return   autoTagPlanService.getTaskTagAutoList(taskTagAutoQuery);
    }

    @ApiOperation(value = "查询自动打标签方案详情", notes = "查询自动打标签方案详情", response = TaskTagAuto.class)
    @PostMapping(value = "/getTaskTagAutoDetail")
    public Object getTaskTagAutoDetail(@RequestBody TaskTagAutoDto taskTagAutoDto)throws Exception{
        return   autoTagPlanService.getTaskTagAutoDetail(taskTagAutoDto);
    }


    @ApiOperation(value = "修改自动打标签方案(只有事件触发的有编辑)", notes = "修改自动打标签方案(只有事件触发的有编辑)", response = Boolean.class)
    @PostMapping(value = "/updateTaskTagAuto")
    public Object updateTaskTagAuto(@RequestBody TaskTagAutoDto taskTagAutoDto)throws Exception{
        autoTagPlanService.updateTaskTagAuto(taskTagAutoDto);
        return true;
    }

    @ApiOperation(value = "删除自动打标签方案", notes = "修改自动打标签方案(只有事件出发的有编辑)", response = Boolean.class)
    @PostMapping(value = "/deleTaskTagAuto")
    public Object deleTaskTagAuto(@RequestBody TaskTagAutoDto taskTagAutoDto)throws Exception{
        autoTagPlanService.deleTaskTagAuto(taskTagAutoDto);
        return true;
    }

    @ApiOperation(value = "获取自动打标签方案机器人列表", notes = "获取自动打标签方案机器人列表", response = TaskTagAutoDeviceVo.class)
    @PostMapping(value = "/getTaskTagAutoDeviceList")
    public Object getTaskTagAutoDeviceList(@RequestBody TaskTagAutoDeviceListQuery taskTagAutoDeviceListQuery)throws Exception{
       return autoTagPlanService.getTaskTagAutoDeviceList(taskTagAutoDeviceListQuery);
    }

    @ApiOperation(value = "修改自动打标签方案机器人列表", notes = "修改自动打标签方案机器人列表", response = Boolean.class)
    @PostMapping(value = "/updateTaskTagAutoDevice")
    public Object updateTaskTagAutoDevice(@RequestBody TaskTagAutoDeviceDto taskTagAutoDeviceDto)throws Exception{
        autoTagPlanService.updateTaskTagAutoDevice(taskTagAutoDeviceDto);
        return true;
    }

    @ApiOperation(value = "批量修改自动打标签方案机器人列表休眠规则", notes = "批量修改自动打标签方案机器人列表休眠规则", response = Boolean.class)
    @PostMapping(value = "/updateTaskTagAutoDeviceSleepRule")
    public Object batchUpdateTaskTagAutoDeviceSleepRule(@RequestBody BatchUpdateTaskTagAutoDeviceDto BatchUpdateTaskTagAutoDeviceDto)throws Exception{
        autoTagPlanService.batchUpdateTaskTagAutoDeviceSleepRule(BatchUpdateTaskTagAutoDeviceDto);
        return true;
    }

    @ApiOperation(value = "批量删除自动打标签方案机器人关系", notes = "批量删除自动打标签方案机器人关系", response = Boolean.class)
    @PostMapping(value = "/batchdeleTaskTagAutoDevice")
    public Object batchdeleTaskTagAutoDevice(@RequestBody BatchdeleTaskTagAutoDeviceDto batchdeleTaskTagAutoDeviceDto)throws Exception{
        autoTagPlanService.batchdeleTaskTagAutoDevice(batchdeleTaskTagAutoDeviceDto);
        return true;
    }


}
